type Menu = {
  path: string
  name: string
  type: 'menu' | 'button'
  layout?: 'default'
  hidden?: boolean
  componentPath?: string
  meta?: MenuMeta
  roles?: []
  sort: number
  level: number
  children?: Menu[]
  redirect?: string
}

type MenuMeta = {
  title: string
  icon?: string
}

const menus = (): Menu[] => {
  return [
    {
      path: '/home',
      hidden: false,
      name: 'Home',
      level: 0,
      sort: 0,
      type: 'menu',
      layout: 'default',
      meta: {
        title: '首页',
        icon: 'HomeFilled'
      },
      redirect: '/home/index',
      children: [
        {
          path: 'index',
          componentPath: 'home/index.vue',
          name: 'HomeIndex',
          level: 1,
          sort: 0,
          type: 'menu',
          hidden: true
        }
      ]
    },
    {
      path: "/user",
      layout: 'default',
      name: 'User',
      type: 'menu',
      level: 0,
      sort: 1,
      hidden: false,
      meta: { title: '用户管理', icon: 'UserFilled' },
      redirect: "/user/info",
      children: [
        {
          path: "info",
          componentPath: "user/info.vue",
          name: "UserInfo",
          level: 0,
          sort: 0,
          meta: {
            title: "用户信息",
            icon: 'UserFilled'
          },
          type: 'menu',
          hidden: false
        },
      ],
    },
    {
      path: '/login',
      componentPath: 'login/index.vue',
      name: 'Login',
      meta: {
        title: '登录'
      },
      level: 1,
      sort: 0,
      type: 'menu'
    }
  ]
}

export default [
  {
    url: '/mock/menus',
    method: 'get',
    response: () => {
      return {
        status: 200,
        data: menus,
        message: 'success'
      }
    }
  }
]